import java.util.ArrayList;
import java.util.List;

public class ReadPacketMain {
    public static void main(String[] args) {

        // 1.创建一个红包对象
        ReadPacket readPacket = new ReadPacket(100, 3);

        // 2.创建3个用户
        User user1 = new User("李杰", 0);
        User user2 = new User("王梦", 0);
        User user3 = new User("老邬", 0);

        //3. 把多个用户保存到一个集合中
        List<User> userList = new ArrayList<>();
        userList.add(user1);
        userList.add(user2);
        userList.add(user3);

        // 4、把红包对象和用户集合全部传给ReadPacketHeader类来处理
        ReadPacketHeader readPacketHanlder = new ReadPacketHeader(readPacket, userList);

        readPacketHanlder.print();
        System.out.println("===========================");

        // 5、抢红包了(a、先把这个大红包分成3份，b、再把3份分给用户)
        readPacketHanlder.handout();

        // 6、打印抢红包的明细
        readPacketHanlder.print();

    }
}
